package com.iversonx.proxy.example_1.controller.v3;

import com.iversonx.proxy.example_1.controller.v2.IUserController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 *
 **/
@Component
public class UserControllerFactory {
    @Autowired
    private Map<String, IUserController> userControllerMap;
    
    @Autowired
    private UserControllerProxyV2 proxy;
    
    public IUserController getUserController(String beanName) {
        IUserController userController = userControllerMap.get(beanName);
        return proxy.createProxy(userController);
    }
}
